package com.ztman.router.common.core.http;

import com.ztman.router.common.core.BaseResponse;
import com.ztman.router.common.presenter.presenter_apis_data.FeedArticleListData;
import com.ztman.router.common.presenter.presenter_apis_data.GeeksApis;
import com.ztman.router.common.presenter.presenter_apis_data.LoginData;

import javax.inject.Inject;

import io.reactivex.Observable;

/**
 * @Title:RetrofitHelp
 * @Package:com.ztman.router.common.core
 * @Description:
 * @Auther:YJH
 * @Email:yuannunhua@gmail.com
 * @Date:2018/5/1611:42
 */
public class RetrofitHelper implements HttpHelper {
    private GeeksApis mGeeksApis;
    @Inject
    RetrofitHelper(GeeksApis _mGeeksApis){
        mGeeksApis = _mGeeksApis;
    }

    @Override
    public Observable<BaseResponse<FeedArticleListData>> getFeedArticleList(int pageNum) {
        return mGeeksApis.getFeedArticleList(pageNum);
    }

    @Override
    public Observable<BaseResponse<FeedArticleListData>> getSearchList(int pageNum, String k) {
        return mGeeksApis.getSearchList(pageNum, k);
    }

    @Override
    public Observable<BaseResponse<FeedArticleListData>> getKnowledgeHierarchyDetailData(int page, int cid) {
        return mGeeksApis.getKnowledgeHierarchyDetailData(page, cid);
    }

    @Override
    public Observable<BaseResponse<LoginData>> getLoginData(String username, String password) {
        return mGeeksApis.getLoginData(username, password);
    }

    @Override
    public Observable<BaseResponse<LoginData>> getRegisterData(String username, String password, String rePassword) {
        return mGeeksApis.getRegisterData(username, password, rePassword);
    }
}
